package main

import "fmt"

func main() {
	c := make(chan int)
	go worker(c)
	for v := range c {
		fmt.Println(v)
	}

}

func worker(c chan int) {
	for i := 0; i < 3; i++ {
		c <- i

	}
	close(c)
}
